]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: Avoid saving any notification if we've none
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 10 Sep 2026 17:15:30 +0000 (19:15 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 13 Sep 2026 18:18:08 +0000 (20:18 +0200)
We used to save an empty variant, and load it for no reason, we can just
avoid saving at all (and deleting if needed)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4400>
(cherry picked from commit ee95df839920b20ae4633d1bfd89a97384fbee2f)

js/ui/notificationDaemon.js

index 9ea539c56a620e20d692afcaf1fb28167388c51c..26df9655ee7058ccfb80a73b223c7df7d2d4a1d8 100644 (file)
@@ -665,7 +665,9 @@ class GtkNotificationDaemon {
         }
 
         global.set_persistent_state(NOTIFICATION_SERIALIZED_NAME,
-            new GLib.Variant(NOTIFICATION_SERIALIZED_FORMAT, sources));
+            sources.length
+                ? new GLib.Variant(NOTIFICATION_SERIALIZED_FORMAT, sources)
+                : null);
     }
 
     AddNotificationAsync(params, invocation) {